{% extends 'layout.html' %}
{%block content%}
<div class="main_model fl">
  <!-- 主体内容 -->
  <div class="main_content">
    <div class="listBox">
      <h1>{{title}}</h1>
      <p class="colDefault">
        作者: <span class="colInfo">{{user.username}}</span>
        时间:<span class="colInfo">{{addTime|date('Y年m月d日 h:i:s', -8*60)}}</span>
        阅读:<span class="colInfo">{{views}}</span>
        评论:<span class="colInfo">{{comments.length}}</span>
      </p>
      <div class="allContent">
        {{content}}
      </div>
    </div>
  </div>
  <!-- 评论 -->
  <div class="comment">
    <div class="comment_title line">
      <strong class="fl">评论</strong>
      <em class="fr">一共有
        <span class="comment_count"></span>
        条评论</em>
    </div>
    <div class="comment_author line"></div>
    {% if userInfo._id %}
    <div class="comment_content clear">
      <textarea id="messageContent"></textarea>
      <input type="hidden" id="contentId" value="{{id}}">
      <button id="messageBtn" class="submit">提交</button>
    </div>
    {% else %}
    <div class="comment_content clear">
      <textarea id="messageContent" disabled></textarea>
      <button id="messageBtn" class="submit" disabled>提交</button>
    </div>
    <div class="comment_info line">
      <p>
        你还没有登录，请先登录！
      </p>
    </div>
    {% endif %}
    <div class="comment_comments">
    </div>
    <div class="pager">
      <ul class="clear">
        <li class="previous">
          <a href="">上一页</a>
        </li>
        <li></li>
        <li class="next">
          <a href="">下一页</a>
        </li>
      </ul>
    </div>
  </div>
</div>
<script src="/public/js/comment.js"></script>

{%endblock%}
